<?php

declare(strict_types=1);

/**
 * @Author:     Frank
 * @contact     frank_hhm@163.com
 * @Date:       2023-01-31 18:53:18
 * @Last Modified time: 2023-01-31 19:04:19
 */

namespace frank\exception;

use Throwable;

/**
 * Class AuthException
 * @package frank\exception
 */
class AuthException extends \RuntimeException
{
    public function __construct($message = "", $code = 0, \Throwable $previous = null)
    {
        if (is_array($message)) {
            $errInfo = $message;
            $message = $errInfo[1] ?? '未知错误';
           	if ($code === -1) {
                $code = $errInfo[0] ?? 0;
            }
        }
        parent::__construct($message, $code, $previous);
    }
}
